package com.bili.bili_data_api.controller;

import com.bili.bili_data_api.dao.pojo.GaoxiaoArea;
import com.bili.bili_data_api.service.GaoxiaoAreaService;
import com.bili.bili_data_api.util.Result;
import com.bili.bili_data_api.vo.GaoxiaoAreaVo;
import com.bili.bili_data_api.vo.QueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("gaoxiao")
public class GaoxiaoAreaController {
    @Autowired
    GaoxiaoAreaService gaoxiaoAreaService;

    @PostMapping(value = {"selectByTitle"},produces = {"application/json; charset=UTF-8"})
    public GaoxiaoAreaVo selectByTitle(@RequestBody QueryVo query){
        return gaoxiaoAreaService.selectByTitle(query);
    }

    @PostMapping(value = {"edit"},produces = {"application/json; charset=UTF-8"})
    public Result edit(@RequestBody GaoxiaoArea gaoxiaoArea){
        return gaoxiaoAreaService.edit(gaoxiaoArea);
    }

    @PostMapping(value = {"delete"},produces = {"application/json; charset=UTF-8"})
    public Result delete(@RequestBody GaoxiaoArea gaoxiaoArea){
        return gaoxiaoAreaService.delete(gaoxiaoArea);
    }

    @PostMapping(value = {"add"},produces = {"application/json; charset=UTF-8"})
    public Result add(@RequestBody GaoxiaoArea gaoxiaoArea){
        return gaoxiaoAreaService.add(gaoxiaoArea);
    }

}
